Skip to content

fix(python-sdks): v4 API migration for integration packages - #1434

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix/python-sdks-v4-api
Sep 1, 2026
Merged

fix(python-sdks): v4 API migration for integration packages#1434
graphite-app[bot] merged 1 commit into
mainfrom
fix/python-sdks-v4-api

Conversation

@Dhravya

@Dhravya Dhravya commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

  • agent-framework: proactive search tool descriptions
  • cartesia / pipecat: v4 client.add + hybrid search, dedupe fixes, tests

Stacked on #1433

Test plan

  • pytest in agent-framework, cartesia, pipecat packages

Made with Cursor

@claude

claude Bot commented Aug 8, 2026

Copy link
Copy Markdown

Claude finished @Dhravya's task in 1m 54s —— View job


Review Complete

  • Fetch PR diff and existing review comments
  • Analyze changes for bugs, security issues, and logic errors
  • Submit review summary

Result: No issues found. The v4 API migration is well-implemented with proper handling of hybrid search responses, deprecation warnings for removed parameters, and robust storage queue logic.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
supermemory-mcp c262cc9 Sep 01 2026, 06:17 AM

@Dhravya
Dhravya force-pushed the fix/python-sdks-v4-api branch from 2b9934b to c449b2f Compare August 8, 2026 02:47
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app c262cc9 Commit Preview URL

Branch Preview URL
Sep 01 2026, 06:20 AM

Dhravya commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c449b2f. Configure here.

chunk_threshold=0.6,
include_full_docs=include_full_docs,
threshold=0.6,
search_mode="hybrid",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include_full_docs ignored

Medium Severity

The v4 migration stops passing include_full_docs to search.memories, but the tool still exposes that parameter with a default of True. Callers or agents that set include_full_docs=False get the same hybrid search as when it is True, so documented tool behavior no longer matches runtime.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c449b2f. Configure here.

# Stainless SDK returns pydantic models (attribute access, snake_case).
memory = getattr(item, "memory", None)
if isinstance(memory, str):
trimmed = memory.strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dedupe drops chunk-only hits

Medium Severity

extract_memory_text only reads the memory field on dicts and SDK models. Hybrid v4 results that populate chunk or content instead (as cartesia/pipecat handle in this PR) are treated as empty and dropped from deduplicated search output used by middleware and context providers.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c449b2f. Configure here.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.

Issues found: None — this looks good to ship.

The two issues flagged by Cursor Bugbot have been addressed in subsequent commits:

  1. include_full_docs ignored ✅ Fixed — The parameter is now Optional[bool] = None with a deprecation warning, and the model-facing tool (_search_memories_tool) properly omits it. The README documents the deprecation.

  2. Dedupe drops chunk-only hits ✅ Fixed — All three packages now check ("memory", "chunk", "content") fields when extracting text from v4 search results.

Notable improvements in this PR:

  • Consistent _field() helper across cartesia/pipecat for reading dict or pydantic model fields
  • Date-prefix normalization in deduplication prevents false duplicates between profile and search results
  • Pipecat storage queue with retry-on-failure and proper cleanup drain
  • Cartesia per-turn context injection with legacy fallback for older Line versions

Score: 9/10

Minor observation: The unbounded storage queue in pipecat could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.

Issues found: None — this looks good to ship.

The two issues flagged by Cursor Bugbot have been addressed in subsequent commits:

  1. include_full_docs ignored ✅ Fixed — The parameter is now Optional[bool] = None with a deprecation warning at tools.py:97-103, and the model-facing tool (_search_memories_tool at line 212) properly omits it. The README documents the deprecation.

  2. Dedupe drops chunk-only hits ✅ Fixed — All three packages now check ("memory", "chunk", "content") fields when extracting text from v4 search results (e.g., utils.py:100-109 in agent-framework).

Notable improvements in this PR:

  • Consistent _field() helper across cartesia/pipecat for reading dict or pydantic model fields
  • Date-prefix normalization in deduplication prevents false duplicates between profile and search results
  • Pipecat storage queue with retry-on-failure and proper cleanup drain via _drain_storage_queue()
  • Cartesia per-turn context injection with legacy fallback for older Line versions via _agent_accepts_context()
  • OpenAI middleware now properly threads sync client.add calls and adds timeout/redirect handling

Score: 9/10

Minor observation: The unbounded storage queue in pipecat (_storage_queue: deque) could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss. The _drain_storage_queue() method provides graceful cleanup at teardown.

ved015
ved015 previously approved these changes Aug 24, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.

Issues found: None — this looks good to ship.

The two issues flagged by Cursor Bugbot have been addressed in subsequent commits:

  1. include_full_docs ignored ✅ Fixed — The parameter is now Optional[bool] = None with a deprecation warning at tools.py:97-103, and the model-facing tool (_search_memories_tool at line 212) properly omits it. The README documents the deprecation.

  2. Dedupe drops chunk-only hits ✅ Fixed — All three packages now check ("memory", "chunk", "content") fields when extracting text from v4 search results (e.g., utils.py:100-109 in agent-framework, cartesia's _field() helper at utils.py:50-67, pipecat's equivalent at utils.py:57-73).

Notable improvements:

  • Consistent _field() helper across cartesia/pipecat for reading dict or pydantic model fields
  • Date-prefix normalization in deduplication prevents false duplicates between profile and search results
  • Pipecat storage queue with retry-on-failure and proper cleanup drain via _drain_storage_queue()
  • Cartesia per-turn context injection with legacy fallback for older Line versions via _agent_accepts_context()
  • OpenAI middleware properly threads sync client.add calls via asyncio.to_thread and adds timeout/redirect handling
  • CI workflows pinned to commit SHAs and test against minimum/current dependency versions

Score: 9/10

Minor observation: The unbounded storage queue in pipecat (_storage_queue: deque) could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss and the _drain_storage_queue() method provides graceful cleanup at teardown.

@graphite-app

graphite-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merge activity

@Dhravya
Dhravya force-pushed the fix/python-sdks-v4-api branch from 5462e20 to 96354fa Compare September 1, 2026 05:58
@Dhravya
Dhravya force-pushed the feat/ai-sdk-tool-reexports branch from dbafb2d to 35e20d9 Compare September 1, 2026 05:58

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.

Issues found: None — this looks good to ship.

The two issues flagged by Cursor Bugbot have been addressed:

  1. include_full_docs ignored ✅ Fixed — The parameter is now Optional[bool] = None with a deprecation warning at tools.py:97-103, and the model-facing tool (_search_memories_tool) properly omits it from the tool schema.

  2. Dedupe drops chunk-only hits ✅ Fixed — All three packages now check ("memory", "chunk", "content") fields when extracting text from v4 search results.

Notable improvements:

  • Consistent _field() helper across cartesia/pipecat for reading dict or pydantic model fields
  • Date-prefix normalization in deduplication prevents false duplicates between profile and search results
  • Pipecat storage queue with retry-on-failure and proper cleanup via _drain_storage_queue()
  • Cartesia per-turn context injection with legacy fallback for older Line versions via _agent_accepts_context()
  • OpenAI middleware properly threads sync client.add calls via asyncio.to_thread and adds timeout/redirect handling
  • CI workflows pinned to commit SHAs and test against minimum/current dependency versions

Score: 9/10

Minor observation: The unbounded storage queue in pipecat (_storage_queue: deque) could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss, and the _drain_storage_queue() method provides graceful cleanup at teardown.

@graphite-app
graphite-app Bot force-pushed the feat/ai-sdk-tool-reexports branch from 35e20d9 to 46d1b53 Compare September 1, 2026 06:00
graphite-app Bot pushed a commit that referenced this pull request Sep 1, 2026
## Summary
- **agent-framework**: proactive search tool descriptions
- **cartesia / pipecat**: v4 `client.add` + hybrid search, dedupe fixes, tests

Stacked on #1433

## Test plan
- [ ] pytest in agent-framework, cartesia, pipecat packages

Made with [Cursor](https://cursor.com)
@graphite-app
graphite-app Bot force-pushed the fix/python-sdks-v4-api branch from 96354fa to 6462215 Compare September 1, 2026 06:01
graphite-app Bot pushed a commit that referenced this pull request Sep 1, 2026
## Summary
- Update `SKILL.md` with proactive search and full 7-tool surface
- Refresh `sdk-guide.md` with v4 API examples and tool descriptions

Stacked on #1434

## Test plan
- [ ] Review skill content for accuracy

Made with [Cursor](https://cursor.com)
@graphite-app
graphite-app Bot changed the base branch from feat/ai-sdk-tool-reexports to main September 1, 2026 06:08
@graphite-app
graphite-app Bot dismissed ved015’s stale review September 1, 2026 06:08

The base branch was changed.

## Summary
- **agent-framework**: proactive search tool descriptions
- **cartesia / pipecat**: v4 `client.add` + hybrid search, dedupe fixes, tests

Stacked on #1433

## Test plan
- [ ] pytest in agent-framework, cartesia, pipecat packages

Made with [Cursor](https://cursor.com)
@graphite-app
graphite-app Bot force-pushed the fix/python-sdks-v4-api branch from 6462215 to c262cc9 Compare September 1, 2026 06:10
graphite-app Bot pushed a commit that referenced this pull request Sep 1, 2026
## Summary
- Update `SKILL.md` with proactive search and full 7-tool surface
- Refresh `sdk-guide.md` with v4 API examples and tool descriptions

Stacked on #1434

## Test plan
- [ ] Review skill content for accuracy

Made with [Cursor](https://cursor.com)
@polylane

polylane Bot commented Sep 1, 2026

Copy link
Copy Markdown

Note

Production impact unlikely.

No production resources are plausibly affected by this change.

Dependency changes

Package Change Jump Release age
supermemory 3.1.03.16.0 minor 7 months

review-in-polylane disable-pr-reviews

Polylane analysed c262cc9 for production impact.

@graphite-app
graphite-app Bot merged commit c262cc9 into main Sep 1, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants